﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
using Studio77.RuneMaster.Core;

namespace Studio77.RuneMaster.Pages
{
    public partial class ScorePage : PhoneApplicationPage
    {
        public ScorePage()
        {
            InitializeComponent();
        }

        protected override void OnNavigatedTo(NavigationEventArgs e)
        {
            base.OnNavigatedTo(e);

            //更新界面
            this.txtHighScore.Text = StageManager.Instance.GameHightlightsRecord.HighScore.ToString();
            this.txtMaxCombo.Text = StageManager.Instance.GameHightlightsRecord.MaxCombo.ToString();
            this.txtScoreByOne.Text = StageManager.Instance.GameHightlightsRecord.HighScoreIn1.ToString();
            this.txtTotalCombo.Text = StageManager.Instance.GameHightlightsRecord.TotalCombo.ToString();
            if (StageManager.Instance.GameHightlightsRecord.TotalMove != 0)
            {
                this.txtScorePerMove.Text = (StageManager.Instance.GameHightlightsRecord.TotalScore / StageManager.Instance.GameHightlightsRecord.TotalMove).ToString();
            }
        }
    }
}